]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Show system background and animate on the same frame
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Tue, 17 Mar 2020 07:58:21 +0000 (15:58 +0800)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 25 Mar 2020 22:41:54 +0000 (22:41 +0000)
Previously we'd show the system background and then wait till the
main loop was idle before beginning the shell startup animation.
This resulted in one initial frame that was always just the system
background.

Now we try to get both the system background and the startup animation
begun on the same first frame.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1102

js/ui/layout.js

index a02cab641534a940f1687d4b8504921f4ae49202..f688fa2441537467031008113cf3ceb7220ec6d9 100644 (file)
@@ -612,10 +612,20 @@ var LayoutManager = GObject.registerClass({
 
         let signalId = this._systemBackground.connect('loaded', () => {
             this._systemBackground.disconnect(signalId);
-            this._systemBackground.show();
-            global.stage.show();
 
-            this._prepareStartupAnimation();
+            // We're mostly prepared for the startup animation
+            // now, but since a lot is going on asynchronously
+            // during startup, let's defer the startup animation
+            // until the event loop is uncontended and idle.
+            // This helps to prevent us from running the animation
+            // when the system is bogged down
+            const id = GLib.idle_add(GLib.PRIORITY_LOW, () => {
+                this._systemBackground.show();
+                global.stage.show();
+                this._prepareStartupAnimation();
+                return GLib.SOURCE_REMOVE;
+            });
+            GLib.Source.set_name_by_id(id, '[gnome-shell] Startup Animation');
         });
     }
 
@@ -672,17 +682,7 @@ var LayoutManager = GObject.registerClass({
 
         this.emit('startup-prepared');
 
-        // We're mostly prepared for the startup animation
-        // now, but since a lot is going on asynchronously
-        // during startup, let's defer the startup animation
-        // until the event loop is uncontended and idle.
-        // This helps to prevent us from running the animation
-        // when the system is bogged down
-        let id = GLib.idle_add(GLib.PRIORITY_LOW, () => {
-            this._startupAnimation();
-            return GLib.SOURCE_REMOVE;
-        });
-        GLib.Source.set_name_by_id(id, '[gnome-shell] this._startupAnimation');
+        this._startupAnimation();
     }
 
     _startupAnimation() {